<%@page import="online_store.model.bus.ProductBus"%>
<%@page import="online_store.utils.ApplicationContextProvider"%>
<%@page import="online_store.model.dto.DefaultDataForm"%>
<%@page import="online_store.model.dto.CategoryDTO"%>
<%@page import="online_store.model.dto.ProductDTO"%>
<%@page import="java.util.List"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link href="<c:url value="/css/style.css" />" rel="stylesheet" type="text/css">
<title>Insert title here</title>
</head>
<body>

<%
	List<ProductDTO> product_list = ApplicationContextProvider.getApplicationContext().getBean(ProductBus.class).findAll();
%>



	<div class="center_content">
      <div class="center_title_bar">Latest Products</div>
      <div class="prod_box">
        <div class="top_prod_box"></div>
        <div class="center_prod_box">
          <div class="product_title"><a href="details.html">Motorola 156 MX-VL</a></div>
          <div class="product_img"><a href="details.html"><img src="images/laptop.gif" alt="" border="0" /></a></div>
          <div class="prod_price"><span class="reduce">350$</span> <span class="price">270$</span></div>
        </div>
        <div class="bottom_prod_box"></div>
        <div class="prod_details_tab"> <a href="http://all-free-download.com/free-website-templates/" title="header=[Add to cart] body=[&nbsp;] fade=[on]"><img src="images/cart.gif" alt="" border="0" class="left_bt" /></a> <a href="http://all-free-download.com/free-website-templates/" title="header=[Specials] body=[&nbsp;] fade=[on]"><img src="images/favs.gif" alt="" border="0" class="left_bt" /></a> <a href="http://all-free-download.com/free-website-templates/" title="header=[Gifts] body=[&nbsp;] fade=[on]"><img src="images/favorites.gif" alt="" border="0" class="left_bt" /></a> <a href="details.html" class="prod_details">details</a> </div>
      </div>
    
    <%
    	for(int i = 0; i < product_list.size(); i++){
    %>
		<div class="prod_box">
			<div class="top_prod_box"></div>
			<div class="center_prod_box">
				<div class="product_title">
					<a href="details.html"><%= product_list.get(i).getName()%></a>
				</div>
				<div class="product_img">
					<a href="details.html"><img src='<%= request.getContextPath() + "/product_image/" + product_list.get(i).getImage() %>' alt=""
						border="0" /></a>
				</div>
				<div class="prod_price">
					<span class="price">$<%= product_list.get(i).getPrice()%></span>
				</div>
			</div>
			<div class="bottom_prod_box"></div>
			<div class="prod_details_tab">
				<a href="http://all-free-download.com/free-website-templates/"
					title="header=[Add to cart] body=[&nbsp;] fade=[on]"><img
					src="images/cart.gif" alt="" border="0" class="left_bt" /></a> <a
					href="http://all-free-download.com/free-website-templates/"
					title="header=[Specials] body=[&nbsp;] fade=[on]"><img
					src="images/favs.gif" alt="" border="0" class="left_bt" /></a> <a
					href="http://all-free-download.com/free-website-templates/"
					title="header=[Gifts] body=[&nbsp;] fade=[on]"><img
					src="images/favorites.gif" alt="" border="0" class="left_bt" /></a> <a
					href="details.html" class="prod_details">details</a>
			</div>
		</div>
		<%
    	}
    %>
    
      
     
      
    </div>
</body>
</html>